import request from '@/request.js'

/**
 * 登录
 * @param {data} data 
 */
export function login(data){
    return request({
        url: '/admin/login',
        method: 'post',
        data: data,
    });
}

/**
 * 添加管理员
 */
export function addAdmin(data){
    return request({
        url: '/admin',
        method: 'post',
        data: data
    });
}

/**
 * 修改管理员
 */
export function updateAdmin(data){
    return request({
        url: '/admin',
        method: 'put',
        data: data
    });
}

/**
 * 查询所有
 */
export function selectAll(){
    return request({
        url: '/admin',
        method: 'get',
    });
}

/**
 * 删除
 */
export function del(data){
    return request({
        url: '/admin',
        method: 'delete',
        data: data
    })
}